<? include_once("../../../common/common_setting_unit.php"); //引入通用的设置文件?>




<?php
$new_detail_nid=$_GET['nid'];

$table=$table_Prefix."department";


//单端当前分类下，是否有子分类
    $child_category=select_one_line_all_items($table,"parent_nid = '$new_detail_nid'");

if (count($child_category) > 0)
{


    $arr['status'] = 0;
    $arr['info'] = "当前部门的下面还有子部门，请删除子部分先";
    die(json_encode($arr));
}
    else{


$sql = " DELETE FROM $table WHERE nid= '$new_detail_nid'";
$query=do_query($sql) or die (mysqli_error().'删除数据失败');
    }


if($query)
{
    $result=200;
}
else
{
    $result=0;
}

$arr['status'] = 200;
$arr['info'] = "";
die(json_encode($arr));


?>
